/**
 * 
 */
package hr.fer.zemris.rznu.model.dao.factories;

import hr.fer.zemris.rznu.model.dao.PersistenceUtil;
import hr.fer.zemris.rznu.model.dao.impl.VirtualBettingDAOImpl;
import hr.fer.zemris.rznu.model.dao.interfaces.IVirtualBettingDao;

import javax.persistence.EntityManagerFactory;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Class is Web Application DAO Factory. Allows for easy
 * creation and access to DAO.
 * 
 * @author Dajan
 */
public class DAOFactory {
	
	protected static EntityManagerFactory emf;
	
	public static final Log log = LogFactory.getLog(DAOFactory.class);
	
	static{
		emf = PersistenceUtil.initialize();
	}
	
	
	/**
	 * Creates implementation of ITransportModelDAO.
	 * 
	 * @return implementation of ITransportModelDAO.
	 */
	public static IVirtualBettingDao createVirtualBettingDAO() {
		return new VirtualBettingDAOImpl(emf);
	}

}
